\(\int \frac {(f+g x^2)^2 \log (c (d+e x^2)^p)}{x^2} \, dx\) [334]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [F(-2)]
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 25, antiderivative size = 178 \[ \int \frac {\left (f+g x^2\right )^2 \log \left (c \left (d+e x^2\right )^p\right )}{x^2} \, dx=-4 f g p x+\frac {2 d g^2 p x}{3 e}-\frac {2}{9} g^2 p x^3+\frac {2 \sqrt {e} f^2 p \arctan \left (\frac {\sqrt {e} x}{\sqrt {d}}\right )}{\sqrt {d}}+\frac {4 \sqrt {d} f g p \arctan \left (\frac {\sqrt {e} x}{\sqrt {d}}\right )}{\sqrt {e}}-\frac {2 d^{3/2} g^2 p \arctan \left (\frac {\sqrt {e} x}{\sqrt {d}}\right )}{3 e^{3/2}}-\frac {f^2 \log \left (c \left (d+e x^2\right )^p\right )}{x}+2 f g x \log \left (c \left (d+e x^2\right )^p\right )+\frac {1}{3} g^2 x^3 \log \left (c \left (d+e x^2\right )^p\right ) \]

[Out]

-4*f*g*p*x+2/3*d*g^2*p*x/e-2/9*g^2*p*x^3-2/3*d^(3/2)*g^2*p*arctan(x*e^(1/2)/d^(1/2))/e^(3/2)-f^2*ln(c*(e*x^2+d
)^p)/x+2*f*g*x*ln(c*(e*x^2+d)^p)+1/3*g^2*x^3*ln(c*(e*x^2+d)^p)+4*f*g*p*arctan(x*e^(1/2)/d^(1/2))*d^(1/2)/e^(1/
2)+2*f^2*p*arctan(x*e^(1/2)/d^(1/2))*e^(1/2)/d^(1/2)

Rubi [A] (verified)

Time = 0.10 (sec) , antiderivative size = 178, normalized size of antiderivative = 1.00, number of steps used = 11, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.240, Rules used = {2526, 2498, 327, 211, 2505, 308} \[ \int \frac {\left (f+g x^2\right )^2 \log \left (c \left (d+e x^2\right )^p\right )}{x^2} \, dx=-\frac {2 d^{3/2} g^2 p \arctan \left (\frac {\sqrt {e} x}{\sqrt {d}}\right )}{3 e^{3/2}}+\frac {2 \sqrt {e} f^2 p \arctan \left (\frac {\sqrt {e} x}{\sqrt {d}}\right )}{\sqrt {d}}+\frac {4 \sqrt {d} f g p \arctan \left (\frac {\sqrt {e} x}{\sqrt {d}}\right )}{\sqrt {e}}-\frac {f^2 \log \left (c \left (d+e x^2\right )^p\right )}{x}+2 f g x \log \left (c \left (d+e x^2\right )^p\right )+\frac {1}{3} g^2 x^3 \log \left (c \left (d+e x^2\right )^p\right )+\frac {2 d g^2 p x}{3 e}-4 f g p x-\frac {2}{9} g^2 p x^3 \]

[In]

Int[((f + g*x^2)^2*Log[c*(d + e*x^2)^p])/x^2,x]

[Out]

-4*f*g*p*x + (2*d*g^2*p*x)/(3*e) - (2*g^2*p*x^3)/9 + (2*Sqrt[e]*f^2*p*ArcTan[(Sqrt[e]*x)/Sqrt[d]])/Sqrt[d] + (
4*Sqrt[d]*f*g*p*ArcTan[(Sqrt[e]*x)/Sqrt[d]])/Sqrt[e] - (2*d^(3/2)*g^2*p*ArcTan[(Sqrt[e]*x)/Sqrt[d]])/(3*e^(3/2
)) - (f^2*Log[c*(d + e*x^2)^p])/x + 2*f*g*x*Log[c*(d + e*x^2)^p] + (g^2*x^3*Log[c*(d + e*x^2)^p])/3

Rule 211

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]/a)*ArcTan[x/Rt[a/b, 2]], x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rule 308

Int[(x_)^(m_)/((a_) + (b_.)*(x_)^(n_)), x_Symbol] :> Int[PolynomialDivide[x^m, a + b*x^n, x], x] /; FreeQ[{a,
b}, x] && IGtQ[m, 0] && IGtQ[n, 0] && GtQ[m, 2*n - 1]

Rule 327

Int[((c_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[c^(n - 1)*(c*x)^(m - n + 1)*((a + b*x^n
)^(p + 1)/(b*(m + n*p + 1))), x] - Dist[a*c^n*((m - n + 1)/(b*(m + n*p + 1))), Int[(c*x)^(m - n)*(a + b*x^n)^p
, x], x] /; FreeQ[{a, b, c, p}, x] && IGtQ[n, 0] && GtQ[m, n - 1] && NeQ[m + n*p + 1, 0] && IntBinomialQ[a, b,
 c, n, m, p, x]

Rule 2498

Int[Log[(c_.)*((d_) + (e_.)*(x_)^(n_))^(p_.)], x_Symbol] :> Simp[x*Log[c*(d + e*x^n)^p], x] - Dist[e*n*p, Int[
x^n/(d + e*x^n), x], x] /; FreeQ[{c, d, e, n, p}, x]

Rule 2505

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_)^(n_))^(p_.)]*(b_.))*((f_.)*(x_))^(m_.), x_Symbol] :> Simp[(f*x)^(m +
 1)*((a + b*Log[c*(d + e*x^n)^p])/(f*(m + 1))), x] - Dist[b*e*n*(p/(f*(m + 1))), Int[x^(n - 1)*((f*x)^(m + 1)/
(d + e*x^n)), x], x] /; FreeQ[{a, b, c, d, e, f, m, n, p}, x] && NeQ[m, -1]

Rule 2526

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_)^(n_))^(p_.)]*(b_.))^(q_.)*(x_)^(m_.)*((f_) + (g_.)*(x_)^(s_))^(r_.),
 x_Symbol] :> Int[ExpandIntegrand[(a + b*Log[c*(d + e*x^n)^p])^q, x^m*(f + g*x^s)^r, x], x] /; FreeQ[{a, b, c,
 d, e, f, g, m, n, p, q, r, s}, x] && IGtQ[q, 0] && IntegerQ[m] && IntegerQ[r] && IntegerQ[s]

Rubi steps \begin{align*} \text {integral}& = \int \left (2 f g \log \left (c \left (d+e x^2\right )^p\right )+\frac {f^2 \log \left (c \left (d+e x^2\right )^p\right )}{x^2}+g^2 x^2 \log \left (c \left (d+e x^2\right )^p\right )\right ) \, dx \\ & = f^2 \int \frac {\log \left (c \left (d+e x^2\right )^p\right )}{x^2} \, dx+(2 f g) \int \log \left (c \left (d+e x^2\right )^p\right ) \, dx+g^2 \int x^2 \log \left (c \left (d+e x^2\right )^p\right ) \, dx \\ & = -\frac {f^2 \log \left (c \left (d+e x^2\right )^p\right )}{x}+2 f g x \log \left (c \left (d+e x^2\right )^p\right )+\frac {1}{3} g^2 x^3 \log \left (c \left (d+e x^2\right )^p\right )+\left (2 e f^2 p\right ) \int \frac {1}{d+e x^2} \, dx-(4 e f g p) \int \frac {x^2}{d+e x^2} \, dx-\frac {1}{3} \left (2 e g^2 p\right ) \int \frac {x^4}{d+e x^2} \, dx \\ & = -4 f g p x+\frac {2 \sqrt {e} f^2 p \tan ^{-1}\left (\frac {\sqrt {e} x}{\sqrt {d}}\right )}{\sqrt {d}}-\frac {f^2 \log \left (c \left (d+e x^2\right )^p\right )}{x}+2 f g x \log \left (c \left (d+e x^2\right )^p\right )+\frac {1}{3} g^2 x^3 \log \left (c \left (d+e x^2\right )^p\right )+(4 d f g p) \int \frac {1}{d+e x^2} \, dx-\frac {1}{3} \left (2 e g^2 p\right ) \int \left (-\frac {d}{e^2}+\frac {x^2}{e}+\frac {d^2}{e^2 \left (d+e x^2\right )}\right ) \, dx \\ & = -4 f g p x+\frac {2 d g^2 p x}{3 e}-\frac {2}{9} g^2 p x^3+\frac {2 \sqrt {e} f^2 p \tan ^{-1}\left (\frac {\sqrt {e} x}{\sqrt {d}}\right )}{\sqrt {d}}+\frac {4 \sqrt {d} f g p \tan ^{-1}\left (\frac {\sqrt {e} x}{\sqrt {d}}\right )}{\sqrt {e}}-\frac {f^2 \log \left (c \left (d+e x^2\right )^p\right )}{x}+2 f g x \log \left (c \left (d+e x^2\right )^p\right )+\frac {1}{3} g^2 x^3 \log \left (c \left (d+e x^2\right )^p\right )-\frac {\left (2 d^2 g^2 p\right ) \int \frac {1}{d+e x^2} \, dx}{3 e} \\ & = -4 f g p x+\frac {2 d g^2 p x}{3 e}-\frac {2}{9} g^2 p x^3+\frac {2 \sqrt {e} f^2 p \tan ^{-1}\left (\frac {\sqrt {e} x}{\sqrt {d}}\right )}{\sqrt {d}}+\frac {4 \sqrt {d} f g p \tan ^{-1}\left (\frac {\sqrt {e} x}{\sqrt {d}}\right )}{\sqrt {e}}-\frac {2 d^{3/2} g^2 p \tan ^{-1}\left (\frac {\sqrt {e} x}{\sqrt {d}}\right )}{3 e^{3/2}}-\frac {f^2 \log \left (c \left (d+e x^2\right )^p\right )}{x}+2 f g x \log \left (c \left (d+e x^2\right )^p\right )+\frac {1}{3} g^2 x^3 \log \left (c \left (d+e x^2\right )^p\right ) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.10 (sec) , antiderivative size = 112, normalized size of antiderivative = 0.63 \[ \int \frac {\left (f+g x^2\right )^2 \log \left (c \left (d+e x^2\right )^p\right )}{x^2} \, dx=\frac {1}{9} \left (-\frac {2 g p x \left (18 e f-3 d g+e g x^2\right )}{e}+\frac {6 \left (3 e^2 f^2+6 d e f g-d^2 g^2\right ) p \arctan \left (\frac {\sqrt {e} x}{\sqrt {d}}\right )}{\sqrt {d} e^{3/2}}+\left (-\frac {9 f^2}{x}+18 f g x+3 g^2 x^3\right ) \log \left (c \left (d+e x^2\right )^p\right )\right ) \]

[In]

Integrate[((f + g*x^2)^2*Log[c*(d + e*x^2)^p])/x^2,x]

[Out]

((-2*g*p*x*(18*e*f - 3*d*g + e*g*x^2))/e + (6*(3*e^2*f^2 + 6*d*e*f*g - d^2*g^2)*p*ArcTan[(Sqrt[e]*x)/Sqrt[d]])
/(Sqrt[d]*e^(3/2)) + ((-9*f^2)/x + 18*f*g*x + 3*g^2*x^3)*Log[c*(d + e*x^2)^p])/9

Maple [A] (verified)

Time = 1.80 (sec) , antiderivative size = 127, normalized size of antiderivative = 0.71

method result size
parts \(\frac {g^{2} x^{3} \ln \left (c \left (e \,x^{2}+d \right )^{p}\right )}{3}+2 f g x \ln \left (c \left (e \,x^{2}+d \right )^{p}\right )-\frac {f^{2} \ln \left (c \left (e \,x^{2}+d \right )^{p}\right )}{x}-\frac {2 p e \left (-\frac {g \left (-\frac {1}{3} e g \,x^{3}+d g x -6 e f x \right )}{e^{2}}+\frac {\left (g^{2} d^{2}-6 d e f g -3 e^{2} f^{2}\right ) \arctan \left (\frac {x e}{\sqrt {d e}}\right )}{e^{2} \sqrt {d e}}\right )}{3}\) \(127\)
risch \(-\frac {\left (-g^{2} x^{4}-6 f g \,x^{2}+3 f^{2}\right ) \ln \left (\left (e \,x^{2}+d \right )^{p}\right )}{3 x}-\frac {-3 i g^{2} \pi \,x^{4} {\operatorname {csgn}\left (i c \left (e \,x^{2}+d \right )^{p}\right )}^{2} \operatorname {csgn}\left (i c \right ) d \,e^{2}-3 i g^{2} \pi \,x^{4} \operatorname {csgn}\left (i \left (e \,x^{2}+d \right )^{p}\right ) {\operatorname {csgn}\left (i c \left (e \,x^{2}+d \right )^{p}\right )}^{2} d \,e^{2}+3 i g^{2} \pi \,x^{4} \operatorname {csgn}\left (i \left (e \,x^{2}+d \right )^{p}\right ) \operatorname {csgn}\left (i c \left (e \,x^{2}+d \right )^{p}\right ) \operatorname {csgn}\left (i c \right ) d \,e^{2}+9 i \pi d \,e^{2} f^{2} \operatorname {csgn}\left (i \left (e \,x^{2}+d \right )^{p}\right ) {\operatorname {csgn}\left (i c \left (e \,x^{2}+d \right )^{p}\right )}^{2}-9 i \pi d \,e^{2} f^{2} \operatorname {csgn}\left (i \left (e \,x^{2}+d \right )^{p}\right ) \operatorname {csgn}\left (i c \left (e \,x^{2}+d \right )^{p}\right ) \operatorname {csgn}\left (i c \right )+3 i g^{2} \pi \,x^{4} {\operatorname {csgn}\left (i c \left (e \,x^{2}+d \right )^{p}\right )}^{3} d \,e^{2}-18 i g \,x^{2} \pi f {\operatorname {csgn}\left (i c \left (e \,x^{2}+d \right )^{p}\right )}^{2} \operatorname {csgn}\left (i c \right ) d \,e^{2}+18 i g \,x^{2} \pi f {\operatorname {csgn}\left (i c \left (e \,x^{2}+d \right )^{p}\right )}^{3} d \,e^{2}-9 i \pi d \,e^{2} f^{2} {\operatorname {csgn}\left (i c \left (e \,x^{2}+d \right )^{p}\right )}^{3}-18 i g \,x^{2} \pi f \,\operatorname {csgn}\left (i \left (e \,x^{2}+d \right )^{p}\right ) {\operatorname {csgn}\left (i c \left (e \,x^{2}+d \right )^{p}\right )}^{2} d \,e^{2}+18 i g \,x^{2} \pi f \,\operatorname {csgn}\left (i \left (e \,x^{2}+d \right )^{p}\right ) \operatorname {csgn}\left (i c \left (e \,x^{2}+d \right )^{p}\right ) \operatorname {csgn}\left (i c \right ) d \,e^{2}+9 i \pi d \,e^{2} f^{2} {\operatorname {csgn}\left (i c \left (e \,x^{2}+d \right )^{p}\right )}^{2} \operatorname {csgn}\left (i c \right )-6 g^{2} \ln \left (c \right ) x^{4} d \,e^{2}+4 x^{4} d \,e^{2} g^{2} p -36 g \,x^{2} \ln \left (c \right ) f d \,e^{2}-6 \sqrt {-d e}\, d^{2} p \ln \left (-\sqrt {-d e}\, x -d \right ) g^{2} x +36 \sqrt {-d e}\, p \ln \left (-\sqrt {-d e}\, x -d \right ) f g d e x +18 \sqrt {-d e}\, p \ln \left (-\sqrt {-d e}\, x -d \right ) f^{2} e^{2} x +6 \sqrt {-d e}\, d^{2} p \ln \left (-\sqrt {-d e}\, x +d \right ) g^{2} x -36 \sqrt {-d e}\, p \ln \left (-\sqrt {-d e}\, x +d \right ) f g d e x -18 \sqrt {-d e}\, p \ln \left (-\sqrt {-d e}\, x +d \right ) f^{2} e^{2} x -12 x^{2} d^{2} e \,g^{2} p +72 x^{2} d \,e^{2} f g p +18 \ln \left (c \right ) d \,e^{2} f^{2}}{18 d \,e^{2} x}\) \(742\)

[In]

int((g*x^2+f)^2*ln(c*(e*x^2+d)^p)/x^2,x,method=_RETURNVERBOSE)

[Out]

1/3*g^2*x^3*ln(c*(e*x^2+d)^p)+2*f*g*x*ln(c*(e*x^2+d)^p)-f^2*ln(c*(e*x^2+d)^p)/x-2/3*p*e*(-g/e^2*(-1/3*e*g*x^3+
d*g*x-6*e*f*x)+(d^2*g^2-6*d*e*f*g-3*e^2*f^2)/e^2/(d*e)^(1/2)*arctan(x*e/(d*e)^(1/2)))

Fricas [A] (verification not implemented)

none

Time = 0.34 (sec) , antiderivative size = 366, normalized size of antiderivative = 2.06 \[ \int \frac {\left (f+g x^2\right )^2 \log \left (c \left (d+e x^2\right )^p\right )}{x^2} \, dx=\left [-\frac {2 \, d e^{2} g^{2} p x^{4} - 3 \, {\left (3 \, e^{2} f^{2} + 6 \, d e f g - d^{2} g^{2}\right )} \sqrt {-d e} p x \log \left (\frac {e x^{2} + 2 \, \sqrt {-d e} x - d}{e x^{2} + d}\right ) + 6 \, {\left (6 \, d e^{2} f g - d^{2} e g^{2}\right )} p x^{2} - 3 \, {\left (d e^{2} g^{2} p x^{4} + 6 \, d e^{2} f g p x^{2} - 3 \, d e^{2} f^{2} p\right )} \log \left (e x^{2} + d\right ) - 3 \, {\left (d e^{2} g^{2} x^{4} + 6 \, d e^{2} f g x^{2} - 3 \, d e^{2} f^{2}\right )} \log \left (c\right )}{9 \, d e^{2} x}, -\frac {2 \, d e^{2} g^{2} p x^{4} - 6 \, {\left (3 \, e^{2} f^{2} + 6 \, d e f g - d^{2} g^{2}\right )} \sqrt {d e} p x \arctan \left (\frac {\sqrt {d e} x}{d}\right ) + 6 \, {\left (6 \, d e^{2} f g - d^{2} e g^{2}\right )} p x^{2} - 3 \, {\left (d e^{2} g^{2} p x^{4} + 6 \, d e^{2} f g p x^{2} - 3 \, d e^{2} f^{2} p\right )} \log \left (e x^{2} + d\right ) - 3 \, {\left (d e^{2} g^{2} x^{4} + 6 \, d e^{2} f g x^{2} - 3 \, d e^{2} f^{2}\right )} \log \left (c\right )}{9 \, d e^{2} x}\right ] \]

[In]

integrate((g*x^2+f)^2*log(c*(e*x^2+d)^p)/x^2,x, algorithm="fricas")

[Out]

[-1/9*(2*d*e^2*g^2*p*x^4 - 3*(3*e^2*f^2 + 6*d*e*f*g - d^2*g^2)*sqrt(-d*e)*p*x*log((e*x^2 + 2*sqrt(-d*e)*x - d)
/(e*x^2 + d)) + 6*(6*d*e^2*f*g - d^2*e*g^2)*p*x^2 - 3*(d*e^2*g^2*p*x^4 + 6*d*e^2*f*g*p*x^2 - 3*d*e^2*f^2*p)*lo
g(e*x^2 + d) - 3*(d*e^2*g^2*x^4 + 6*d*e^2*f*g*x^2 - 3*d*e^2*f^2)*log(c))/(d*e^2*x), -1/9*(2*d*e^2*g^2*p*x^4 -
6*(3*e^2*f^2 + 6*d*e*f*g - d^2*g^2)*sqrt(d*e)*p*x*arctan(sqrt(d*e)*x/d) + 6*(6*d*e^2*f*g - d^2*e*g^2)*p*x^2 -
3*(d*e^2*g^2*p*x^4 + 6*d*e^2*f*g*p*x^2 - 3*d*e^2*f^2*p)*log(e*x^2 + d) - 3*(d*e^2*g^2*x^4 + 6*d*e^2*f*g*x^2 -
3*d*e^2*f^2)*log(c))/(d*e^2*x)]

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 400 vs. \(2 (182) = 364\).

Time = 60.65 (sec) , antiderivative size = 400, normalized size of antiderivative = 2.25 \[ \int \frac {\left (f+g x^2\right )^2 \log \left (c \left (d+e x^2\right )^p\right )}{x^2} \, dx=\begin {cases} \left (- \frac {f^{2}}{x} + 2 f g x + \frac {g^{2} x^{3}}{3}\right ) \log {\left (0^{p} c \right )} & \text {for}\: d = 0 \wedge e = 0 \\\left (- \frac {f^{2}}{x} + 2 f g x + \frac {g^{2} x^{3}}{3}\right ) \log {\left (c d^{p} \right )} & \text {for}\: e = 0 \\- \frac {2 f^{2} p}{x} - \frac {f^{2} \log {\left (c \left (e x^{2}\right )^{p} \right )}}{x} - 4 f g p x + 2 f g x \log {\left (c \left (e x^{2}\right )^{p} \right )} - \frac {2 g^{2} p x^{3}}{9} + \frac {g^{2} x^{3} \log {\left (c \left (e x^{2}\right )^{p} \right )}}{3} & \text {for}\: d = 0 \\- \frac {2 d^{2} g^{2} p \log {\left (x - \sqrt {- \frac {d}{e}} \right )}}{3 e^{2} \sqrt {- \frac {d}{e}}} + \frac {d^{2} g^{2} \log {\left (c \left (d + e x^{2}\right )^{p} \right )}}{3 e^{2} \sqrt {- \frac {d}{e}}} + \frac {4 d f g p \log {\left (x - \sqrt {- \frac {d}{e}} \right )}}{e \sqrt {- \frac {d}{e}}} - \frac {2 d f g \log {\left (c \left (d + e x^{2}\right )^{p} \right )}}{e \sqrt {- \frac {d}{e}}} + \frac {2 d g^{2} p x}{3 e} + \frac {2 f^{2} p \log {\left (x - \sqrt {- \frac {d}{e}} \right )}}{\sqrt {- \frac {d}{e}}} - \frac {f^{2} \log {\left (c \left (d + e x^{2}\right )^{p} \right )}}{\sqrt {- \frac {d}{e}}} - \frac {f^{2} \log {\left (c \left (d + e x^{2}\right )^{p} \right )}}{x} - 4 f g p x + 2 f g x \log {\left (c \left (d + e x^{2}\right )^{p} \right )} - \frac {2 g^{2} p x^{3}}{9} + \frac {g^{2} x^{3} \log {\left (c \left (d + e x^{2}\right )^{p} \right )}}{3} & \text {otherwise} \end {cases} \]

[In]

integrate((g*x**2+f)**2*ln(c*(e*x**2+d)**p)/x**2,x)

[Out]

Piecewise(((-f**2/x + 2*f*g*x + g**2*x**3/3)*log(0**p*c), Eq(d, 0) & Eq(e, 0)), ((-f**2/x + 2*f*g*x + g**2*x**
3/3)*log(c*d**p), Eq(e, 0)), (-2*f**2*p/x - f**2*log(c*(e*x**2)**p)/x - 4*f*g*p*x + 2*f*g*x*log(c*(e*x**2)**p)
 - 2*g**2*p*x**3/9 + g**2*x**3*log(c*(e*x**2)**p)/3, Eq(d, 0)), (-2*d**2*g**2*p*log(x - sqrt(-d/e))/(3*e**2*sq
rt(-d/e)) + d**2*g**2*log(c*(d + e*x**2)**p)/(3*e**2*sqrt(-d/e)) + 4*d*f*g*p*log(x - sqrt(-d/e))/(e*sqrt(-d/e)
) - 2*d*f*g*log(c*(d + e*x**2)**p)/(e*sqrt(-d/e)) + 2*d*g**2*p*x/(3*e) + 2*f**2*p*log(x - sqrt(-d/e))/sqrt(-d/
e) - f**2*log(c*(d + e*x**2)**p)/sqrt(-d/e) - f**2*log(c*(d + e*x**2)**p)/x - 4*f*g*p*x + 2*f*g*x*log(c*(d + e
*x**2)**p) - 2*g**2*p*x**3/9 + g**2*x**3*log(c*(d + e*x**2)**p)/3, True))

Maxima [F(-2)]

Exception generated. \[ \int \frac {\left (f+g x^2\right )^2 \log \left (c \left (d+e x^2\right )^p\right )}{x^2} \, dx=\text {Exception raised: ValueError} \]

[In]

integrate((g*x^2+f)^2*log(c*(e*x^2+d)^p)/x^2,x, algorithm="maxima")

[Out]

Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'a
ssume' command before evaluation *may* help (example of legal syntax is 'assume(e>0)', see `assume?` for more
details)Is e

Giac [A] (verification not implemented)

none

Time = 0.32 (sec) , antiderivative size = 136, normalized size of antiderivative = 0.76 \[ \int \frac {\left (f+g x^2\right )^2 \log \left (c \left (d+e x^2\right )^p\right )}{x^2} \, dx=-\frac {1}{9} \, {\left (2 \, g^{2} p - 3 \, g^{2} \log \left (c\right )\right )} x^{3} + \frac {1}{3} \, {\left (g^{2} p x^{3} + 6 \, f g p x - \frac {3 \, f^{2} p}{x}\right )} \log \left (e x^{2} + d\right ) - \frac {f^{2} \log \left (c\right )}{x} - \frac {2 \, {\left (6 \, e f g p - d g^{2} p - 3 \, e f g \log \left (c\right )\right )} x}{3 \, e} + \frac {2 \, {\left (3 \, e^{2} f^{2} p + 6 \, d e f g p - d^{2} g^{2} p\right )} \arctan \left (\frac {e x}{\sqrt {d e}}\right )}{3 \, \sqrt {d e} e} \]

[In]

integrate((g*x^2+f)^2*log(c*(e*x^2+d)^p)/x^2,x, algorithm="giac")

[Out]

-1/9*(2*g^2*p - 3*g^2*log(c))*x^3 + 1/3*(g^2*p*x^3 + 6*f*g*p*x - 3*f^2*p/x)*log(e*x^2 + d) - f^2*log(c)/x - 2/
3*(6*e*f*g*p - d*g^2*p - 3*e*f*g*log(c))*x/e + 2/3*(3*e^2*f^2*p + 6*d*e*f*g*p - d^2*g^2*p)*arctan(e*x/sqrt(d*e
))/(sqrt(d*e)*e)

Mupad [B] (verification not implemented)

Time = 1.67 (sec) , antiderivative size = 180, normalized size of antiderivative = 1.01 \[ \int \frac {\left (f+g x^2\right )^2 \log \left (c \left (d+e x^2\right )^p\right )}{x^2} \, dx=\frac {2\,p\,\mathrm {atan}\left (\frac {\sqrt {e}\,p\,x\,\left (-d^2\,g^2+6\,d\,e\,f\,g+3\,e^2\,f^2\right )}{\sqrt {d}\,\left (-p\,d^2\,g^2+6\,p\,d\,e\,f\,g+3\,p\,e^2\,f^2\right )}\right )\,\left (-d^2\,g^2+6\,d\,e\,f\,g+3\,e^2\,f^2\right )}{3\,\sqrt {d}\,e^{3/2}}-x\,\left (4\,f\,g\,p-\frac {2\,d\,g^2\,p}{3\,e}\right )-\frac {2\,g^2\,p\,x^3}{9}-\ln \left (c\,{\left (e\,x^2+d\right )}^p\right )\,\left (\frac {f^2+2\,f\,g\,x^2+g^2\,x^4}{x}-\frac {\frac {4\,g^2\,x^4}{3}+4\,f\,g\,x^2}{x}\right ) \]

[In]

int((log(c*(d + e*x^2)^p)*(f + g*x^2)^2)/x^2,x)

[Out]

(2*p*atan((e^(1/2)*p*x*(3*e^2*f^2 - d^2*g^2 + 6*d*e*f*g))/(d^(1/2)*(3*e^2*f^2*p - d^2*g^2*p + 6*d*e*f*g*p)))*(
3*e^2*f^2 - d^2*g^2 + 6*d*e*f*g))/(3*d^(1/2)*e^(3/2)) - x*(4*f*g*p - (2*d*g^2*p)/(3*e)) - (2*g^2*p*x^3)/9 - lo
g(c*(d + e*x^2)^p)*((f^2 + g^2*x^4 + 2*f*g*x^2)/x - ((4*g^2*x^4)/3 + 4*f*g*x^2)/x)